<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Title</title>
  <style>
    div{
      width: 250px;
    }
  </style>
</head>
<body>
<div title="dog" >
  <img src="" alt="" id="dogimg">
</div>
<script src="https://unpkg.com/axios/dist/axios.min.js"></script>

<script>


  /*  window.fetch('https://api.apishop.net/common/dogFamily/queryDogListByKeyword?apiKey=r6g1BIXa41c8c9c2b979ae5d8ad03f9fd478e74a347e4ab&keyword=金毛犬')

      .then(response => response.json()) //定义返回的类型和数据格式
      .then(data => console.log(data)) // 返回的数据
  */
  /* axios({
     url:'https://api.apishop.net/common/dogFamily/queryDogListByKeyword?apiKey=r6g1BIXa41c8c9c2b979ae5d8ad03f9fd478e74a347e4ab&keyword=金毛犬'
   }).then(res=>{
     console.log(res)
   })*/

  axios({
    url:'https://api.apishop.net/common/dogFamily/queryDogListByKeyword',
    params:{
      apiKey:"r6g1BIXa41c8c9c2b979ae5d8ad03f9fd478e74a347e4ab",
      keyword:'腊肠犬'
    }
  }).then(res=>{
    var x =  document.getElementById('dogimg')
    // console.log(x)
    x.src=res.data.result.petFamilyList[0].coverURL
    // =res.petFamilyList[0].coverURL
    // console.log(res.data.result.petFamilyList[0].coverURL)
  })
</script>
</body>
</html>